/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package session;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import model.Priority;


/**
 *
 * @author AQUA
 */
@Stateless
public class PriorityFacade extends AbstractFacade<Priority> implements PriorityFacadeRemote{
    @PersistenceContext(unitName = "ejb-servPU")
    private EntityManager em;
    @Override
    protected EntityManager getEntityManager() {
        return em;
    }
    public PriorityFacade(){
        super(Priority.class);
    }

    @Override
    public void deleteByID(String id) {
        Priority priority = find(id);
        priority = em.merge(priority);
        em.remove(priority);
    }

    @Override
    public void insert(Priority priority) {
        em.persist(priority);
    }    
    
    @Override
    public Priority merge(Priority priority) {
        return em.merge(priority);
    }
}
